
// A2b_summarize_f_stats_pvals
//==============================================================================

// Description: This file creates a summary file for the p-values related to the 
// f-statistics across sectors

clear
set more off

cd "D:\data_replication"

forval i = 1/4092 {
import delimited statistics_and_graphs/f_statistics/output_files/Fstat_`i'.csv, clear
keep if _n == 9
replace v2 = subinstr(v2,"=","",.)
replace v2 = subinstr(v2, `"""',  "", .)
destring v2, gen(F_stat_p)
rename v2 F_stat_p_string
save statistics_and_graphs/f_statistics/output_files/Fstat_p_`i'.dta, replace
}

use statistics_and_graphs/f_statistics/output_files/Fstat_p_1.dta, clear
rm statistics_and_graphs/f_statistics/output_files/Fstat_p_1.dta
forval i = 2/4092 {
append using statistics_and_graphs/f_statistics/output_files/Fstat_p_`i'.dta
rm statistics_and_graphs/f_statistics/output_files/Fstat_p_`i'.dta
}

save statistics_and_graphs/f_statistics/F_stats_p_summary.dta, replace

